Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workflow to update local member data on pull request #27

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

vladh
Copy link
Member

@vladh vladh commented Aug 3, 2024

This adds the update-new-members.yml workflow. This workflow will run on pull requests targeting the main branch. I think it should run on every commit, we should test this.

This workflow starts out by running bin/update-new-members. This is a script that will figure out what in members.csv changed between the current branch and the main branch. If there are new lines in that file, bin/update-member will be run for each line. This script compares the remote JSON file and the local JSON file (if it exists), and checks which one is more recent using the datetimeModified field. If the remote JSON file is more recent, it is saved in place of the old local JSON file. This change is then automatically committed to the PR's branch.

bin/update-member checks for existing files because it can be used not only to fetch new members, but also to update the data of existing members. I've included a bin/update-all-members script, which will loop through every line in members.csv, and attempt to fetch any updates. Right now, this script is not run, but we can find a way to schedule it.

Note that, when a member is removed, both the entry in members.csv and the .json file needs to be removed by the committer.

I've changed members.csv to have some test URLs so that we can actually see these scripts running.

I've removed the urlSource field in the schema, but let me know if this doesn't make sense. My reasoning is that the single source of truth for the URLs is in members.csv. If we fetch the JSON file, the JSON file doesn't need to tell us where it is — we know where it is because we already fetched it.

As far as I can tell, if this is merged there are two main other things to do:

  • Make the website nice wrt. displaying members' data
  • Add clear and comprehensive “how to make the pledge” instructions for members in README.md

@vladh vladh requested a review from chadwhitacre August 3, 2024 17:51
@vladh vladh mentioned this pull request Aug 3, 2024
@chadwhitacre
Copy link
Contributor

This is a fantastic start! 👏 @vladh

I've read the PR description and given the code a once-over, it looks great at a skim. I think I'll have some more feedback on a closer read but don't want to block on that so I am merging.

@chadwhitacre chadwhitacre merged commit 8cf7a56 into main Aug 3, 2024
3 checks passed
@chadwhitacre chadwhitacre deleted the vladh/schema-continued branch August 3, 2024 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants